using System;

using System.Linq;
using System.Text;
using System.Transactions;
using System.Collections.Generic;
using Entity;
using Common.Background.Entity;
namespace Common.Background.Data
{

    /// <summary>
    /// 
    /// </summary>
    public class WebManageRole_WebManageMenusRepository : BackgroundRepositoryBase, IWebManageRole_WebManageMenusRepository
    {

        #region IWebManageRole_WebManageMenusRepository 成员
        public void DeleteByRoleID(int roleID)
        {
            DB.ExecuteCommand("delete from WebManageRole_WebManageMenus where manageroleid=" + roleID);
        }

        public void Insert(WebManageRole_WebManageMenus entity)
        {
            base.InsertEntity(entity);
        }

        public void Insert(List<WebManageRole_WebManageMenus> list)
        {
            base.InsertEntity(list.Cast<EntityBase>().ToList());
        }

        #endregion

        #region IRepository<WebManageRole_WebManageMenus> 成员

        public void Update(WebManageRole_WebManageMenus entity)
        {
            throw new NotImplementedException("关系表不用更新操作");
        }

        public void Update(IList<WebManageRole_WebManageMenus> list)
        {
            throw new NotImplementedException("关系表不用更新操作");
        }

        public void Insert(IList<WebManageRole_WebManageMenus> list)
        {
            base.InsertEntity(list.Cast<EntityBase>().ToList());
        }

        public WebManageRole_WebManageMenus InsertGetIDENTITY(WebManageRole_WebManageMenus entity)
        {
            base.InsertEntity(entity);
            return this.Find(entity.ManageRoleID, entity.MenuID);
        }

        public void Delete(WebManageRole_WebManageMenus entity)
        {
            base.DeleteEntity(entity);
        }

        public void Delete(IList<WebManageRole_WebManageMenus> list)
        {
            base.DeleteEntity(list.Cast<EntityBase>().ToList());
        }

        public IQueryable<WebManageRole_WebManageMenus> GetModel()
        {
            return this.GetEntities<WebManageRole_WebManageMenus>();
        }

        public WebManageRole_WebManageMenus Find(params object[] keyValues)
        {
            return base.GetEntity<WebManageRole_WebManageMenus>(keyValues);
        }

        #endregion
    }
}
